<template>
	<view>
		<z-paging ref="paging" autowire-list-name="dataList" autowire-query-name="getList">
			<view class="content">
				<view class="index">
					<u-navbar leftText="" :is-back="false" safeAreaInsetTop placeholder>
						<view slot="left" class="leftText">我要找活</view>
					</u-navbar>
					<view
						style="display: flex;flex-direction: row;align-items: center;margin-bottom: 10px;margin-left: 20rpx;">
						<view @click="gotoCity()"
							style="display: flex;flex-direction: row;align-items: center;margin-right: 5px;">
							<!-- <image mode="aspectFill" style="width: 35px;height: 35px;margin-left: 8px;"
								src="https://xgr.oss-cn-hangzhou.aliyuncs.com/icon/index/mini-logo.png">
							</image> -->
							<u-icon style="margin-left: 1px;" label-pos="left"
								:label="cityName == ''? (provinceName == ''? '全国' : provinceName) : cityName "
								name="arrow-down" label-color="#ffffff" color="#ffffff" size="16"></u-icon>
						</view>
						<!-- <view style="padding: 10px;">
							<u-search placeholder="搜索你要找的好活" v-model="keyword"></u-search>
						</view> -->
						<view class="search1">
							<view class="search" style="overflow: hidden;">
								<u-icon name="search" color="#fff" size="16"></u-icon>
								<u--input v-model="search" border="none" placeholder="搜索你要找的好活" color="#fff"
									disabledColor="background-color:none;" @focus="showSearchChoice"
									@blur="offSearchChoice" placeholderStyle="color:rgba(255,255,255,.5)">
								</u--input>
								<view class="" style="width: 100rpx; height: 60rpx;  margin-top: -5rpx;">
									<u-button type="primary" text="搜索" @click='searchbtn' throttleTime="500"></u-button>
								</view>

							</view>
							<!-- 搜索下拉框 -->
							<!-- 	<view class="showSearchChoice" v-if="isShowSearchChoice">
									<u-list height="auto">
										<u-list-item 	v-for="(item, index) in SearchChoiceList" :key="index">
											<u-cell  :title="item" @click="txtSearchChoose(item)">
											</u-cell>
										</u-list-item>
									</u-list>
								</view> -->
						</view>


						<!-- <view class="right" @click="goNavigate('/pagesC/newsinfo/helps')">我要反馈</view> -->
					</view>
					<u-swiper :list="topbannerlist" circular="true" height="100" mode="aspectFit" keyName="image"
						@click="bannerClick()"></u-swiper>
					<!-- 企业注册入口 -->
					<view class="topqy">
						<view class="topqy-item" @click="register(1)">
							企业认证
						</view>
						<view style="width: 1px;height: 40rpx; background-color: gainsboro;margin: auto;"></view>
						<view class="topqy-item" @click="register(2)">
							编辑个人信息
						</view>
					</view>
					<view style="background-color: #f0f0f0; padding-top: 10rpx;">
						<u-scroll-list indicatorColor="#ffffff">
							<view class="scroll-list" style="flex-direction: row;background-color: #f0f0f0;">
								<view class="scroll-list__goods-item" v-for="(item, index) in bannerList" :key="index"
									@click="itemClick(item)">
									<image style="width: 80rpx; height: 80rpx;" :src="item.iconPath"></image>
									<text style="font-size: 26rpx;">{{ item.skillName }}</text>
								</view>
							</view>
						</u-scroll-list>
					</view>
					<!-- 加群链接 -->
					<view style="background-color: #f0f0f0;padding-bottom: 50rpx;">
						<view class="groupcard" @click="gogroup">
							<view class="left">
								<view style="position: relative;">
									<u--image src="https://xgr.oss-cn-hangzhou.aliyuncs.com/WechatIMG936.jpg"
										width='90rpx' height='90rpx'></u--image>
									<u-badge numberType="overflow" type="error" max="99" value=100 absolute
										style="z-index: 1;" :offset="arrau"></u-badge>
								</view>
								<view style="margin-top: 10rpx;width: 350rpx;">
									<text style="padding-left: 20rpx;font-size: 30rpx;font-weight: 400;">招工找活群</text>
									<u-notice-bar direction="column" icon='weixin-fill' duration=4000 color='grey'
										bgColor="#ffffff" :text="text1"></u-notice-bar>
								</view>
							</view>
							<view style="margin-right: 10rpx;">
								<u-button style="font-weight: bold;" text="加入群聊" size="small" type="primary"
									shape="circle"></u-button>
							</view>
						</view>
					</view>
					<view class="listWaip">
						<view class="filter">
							<view class="lTab">
								<view v-for="(ititem,itindex) in lTabList" :key="itindex"
									:class="{ 'active': lTab == itindex }" @click="lTcheck(ititem,itindex)">
									{{ititem.name}}
								</view>
							</view>

							<view class="filterRight">
								<view @click="gongzhongisShow = true; hideKeyboard();appearmask()">
									{{hangyeType?hangyeType:'行业'}}<u-icon name="arrow-down" color="#A1A1A1"
										size="12"></u-icon>
								</view>
								<view @click="show = true; hideKeyboard()">筛选<u-icon name="arrow-down" color="#A1A1A1"
										size="12"></u-icon>
								</view>
							</view>
						</view>
						<block v-if="dataList && dataList.length>0 || dataList.length>0">
							<!-- <z-paging ref="paging" v-model="dataList" @query="getList"></z-paging> -->
							<scroll-view scroll-y="true" class="scroll-Y" :show-scrollbar="false">
								<JobItem v-for="(item,index) in dataList" :key="index" :data="item"
									@jobItemClick="jobItemClick"></JobItem>
							</scroll-view>
							<!-- </z-paging> -->
						</block>
						<block v-if="dataList && dataList.length == 0 && dataList.length == 0">
							<view class="empty-img">
								<image src="https://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/icon50.png"></image>
								<label>暂无内容</label>
							</view>
						</block>
					</view>

				</view>
				<view class="drtint dis-clm" @click="isShowgz()">
					<label>+</label>
					<text>发布</text>
				</view>
				<view :class="{ 'hide-tabbar': isLoading }">
					<uTabbar :value="tabNoindex"></uTabbar>
				</view>

				<u-picker :show="gongzhongisShow" ref="gongzhongPicker" :columns="gongzhongcolumns"
					@confirm="hangyeConfirm" cancelText="重置" @change="bindMultiPickerColumnChange"
					@cancel="gongzhongCancel" @touchmove.stop.prevent></u-picker>
				<!-- <u-picker :show="addressisShow" ref="addressPicker" :columns="addresscolumns" @confirm="addressConfirm" -->
				<!-- @change="addressbindMultiPickerColumnChange" @cancel="addressisShow = false"></u-picker> -->
				<!-- <u-picker mode="region" cancelText="重置" :show="addressisShow" v-model="addressisShow"
					@cancel="addressCancel" @confirm="addressConfirm"></u-picker> -->

				<!-- </z-paging> -->

				<!-- <w-picker :visible.sync="addressisShow" mode="region" :value="defaultRegion" default-type="value"
					:hide-area="false" @confirm="addressConfirm($event,'region')" @cancel="addressCancel"
					ref="region"></w-picker> -->


			</view>
		</z-paging>
		<u-popup :show="show" @close="close">
			<view class="classifyBigBox">
				<view v-for="(item,index) in classifyList" :key="index" @click="choice(index)"
					:class="[item.selected?'selde':'noselde']">
					{{item.selected?item.name:item.name}}
				</view>
			</view>
			<view class="addres-footer dis-row">
				<view class="addres-btn" @click="onClear">清除</view>
				<view class="addres-btn" @click="onConfirmFiltrate">确定选择</view>
			</view>
		</u-popup>
		<!-- 发布弹出层 -->
		<u-popup :show="showzg" @close="closezg" closeOnClickOverlay safeAreaInsetBottom>
			<view style="background-color: #f0f0f0;">
				<text style="display: flex;margin: 20rpx auto;justify-content: center;">发布</text>
				<view class="zgbtn" @click="btnClick">
					<u-button>我要招工人</u-button>
				</view>
				<view v-if="showcard" class="zgbtn" @click="btnClick2">
					<u-button>我要找工作</u-button>
				</view>
			</view>


		</u-popup>
		<u-popup :show="showtogroup" @close="closegp()" mode="center" customStyle="width:80%;overflow: hidden;" round=10
			closeOnClickOverlay closeable>
			<view style="background-color: #ffffff;padding: 20rpx;">
				<text
					style="display: flex;margin: 20rpx auto;justify-content: center;font-size: 38rpx;font-weight: 450;">选择进群方式</text>
				<text style="padding: 0 35rpx;display: block;">1.长按扫描二维码加群</text>
				<text style="padding: 0 35rpx;display: block;color: #606266;">2.微信或内「添加朋友-搜索框」中粘贴牛人账号
					<text style="color:#3c9cff ;">wxid******</text>
					，添加牛人后拉您进群。
				</text>
				<view style="display: flex;justify-content: center;">
					<image :show-menu-by-longpress="true"
						src="https://xgr.oss-cn-hangzhou.aliyuncs.com/WechatIMG966.jpg" mode="widthFix"
						style="width: 70%;border-radius: 20rpx;"></image>
				</view>
				<view class="zgbtn">
					<u-button type="primary" size="large" style="font-weight: 900;"
						@click="copyandtowx">复制并前往微信</u-button>
				</view>
			</view>
		</u-popup>
		<u-popup :show="showsharecode" @close="closesc()" mode="center"
			customStyle="width:80%;overflow: hidden;background-color:#f3f4f6" round=10 closeOnClickOverlay closeable>
			<view style="background-color: #ffffff;padding: 20rpx;">
				<text
					style="display: flex;margin: 20rpx auto;justify-content: center;font-size: 38rpx;font-weight: 450;">长按分享二维码</text>
				<view style="display: flex;justify-content: center;">
					<image :show-menu-by-longpress="true" :src="bufferImg" mode="widthFix"
						style="width: 70%;border-radius: 20rpx;"></image>
				</view>
			</view>

		</u-popup>
		<u-overlay :show="showuploadImage">
			<view class="autloading"
				style="width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;">
				<u-loading-icon :show="showuploadImage" color="white"></u-loading-icon>
			</view>

		</u-overlay>
	</view>
</template>
<script>
	import uTabbar from "@/components/uTabbar/uTabbar.vue";
	import pop from "@/components/ming-pop/ming-cityindex.vue"
	import store from '@/common/store.js'
	import Index from '@/common/index-model.js'
	import fun from '@/common/publicFun.js'
	var amapFile = require('@/utils/amap-wx.js')

	var myAmapFun = new amapFile.AMapWX({
		key: 'a012b582a72fc69505c064e0f4ccd782'
	})

	let index = new Index();
	let that = null;
	export default {
		data() {
			return {
				homepage: '',
				enIdentity: '',
				showuploadImage: false,
				bufferImg: '',
				showsharecode: false, //二维码弹窗
				showtogroup: false, //加群弹窗
				arrau: [-5, -5], //99+定位
				text1: ['要4个师傅干点包，有空的联系我', '老板工期大概是多久', '招泥工师傅1名，350元/天，...', '可以，麻烦通过一下微信'],
				showzg: false,
				showcard: true,
				isLoading: true,
				isShowSearchChoice: false,
				SearchChoiceList: ['普工', '叉车工', '服务员', '兼职', '保安', '销售'],
				topbannerlist: [],
				//定义前端选中的值
				selectList: "",
				selectId: [],
				classifyList: [],
				selected: [], //选取的分类 ,用对象更方便存取数据
				show: false,
				cityName: "西安市", // 文本内容
				provinceName: '',
				containerWidth: 0, // 容器宽度
				textWidth: 60, // 文本宽度

				defaultRegion: ["610000", "610100", "610112"],
				dataList: [],
				bannerList: [],
				lTab: 0,
				lTabList: [{
					name: '最新',
					type: 1
				}],
				hangyeType: '',
				gongzhongcolumns: [0, 0],
				gongzhongList: [],
				gongzhongdata: [],
				gongzhongisShow: false, // 是否显示工种选择
				type: 0,
				skillLevel2: null,
				// skillLevel3: null,
				skillLevel1: null,
				lon: '',
				lat: '',
				cityId: null,
				areaId: null,
				provinceId: null,
				// address: '',
				addresscolumns: [0, 0, 0],
				addressisShow: false, // 是否显示地点弹框
				cityList: [],
				search: "",
				showappearmask: false,
				// skills: [{
				// 	name: '全部'
				// }], //全部位置的技能认证
			};
		},
		components: {
			pop
		},
		onShow() {
			this.getUserInfo()
			const from = uni.getStorageSync('fromPage'); // 获取来源信息
			if (from === 'addjob' || from === 'deljob') {
				console.log('从 SourcePage 返回');
				// 执行特定的操作
				this.$refs.paging.reload();
			}
			// 清除来源信息，避免重复触发
			uni.removeStorageSync('fromPage');
		},
		onLoad() {

			uni.showShareMenu({
				title: '找活干、招工人，就用天下工人',
				imageUrl: 'https://xgr.oss-cn-hangzhou.aliyuncs.com/icon/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20230327160119.png'
			});
			uni.hideTabBar();
			that = this;
			// this.getList() //非授权  找活list
			// this.$refs.paging.reload(true);
			this.getBanner()
			this.getLon()
			this.getQueryType()
			this.getTypeItem()
			uni.$on('backInfo', this.onrecv);
			this.$refs.paging.reload()
		},
		onUnload() {
			uni.$off('backInfo', this.onrecv)
		},
		mounted() {
			// this.getContainerSize();
			setTimeout(() => {
				this.isLoading = false;
			}, 300);
		},
		methods: {
			getUserInfo() {
				if (!uni.getStorageSync('token')) {
					return false
				} else {
					index.getPublicUserMember({}, '/client/individual/homePage', 'get', res => {
						if (res.data.code == 200 && res.data.success) {
							this.homepage = res.data.result;
							console.log('homepage', this.homepage)
						} else {
							return false
						}
					})
				}
			},
			//去加群
			gogroup() {
				// #ifdef MP-WEIXIN
				if (typeof wx.openCustomerServiceChat === 'function') {
					wx.openCustomerServiceChat({
						extInfo: {
							url: "https://work.weixin.qq.com/kfid/kfce7527a080d0f7871"
						},
						corpId: "wwa7dc6cde2804f45d",
						success(res) {
							console.log("接入成功", res)
						},
						fail(err) {
							console.error("失败", err);
							uni.showToast({
								title: "请升级微信版本",
								icon: "none"
							});
						}
					});
				} else {
					uni.showToast({
						title: "当前微信版本过低",
						icon: "none"
					});
				}
				// #endif
				// this.showtogroup = true
			},
			copyandtowx() {
				const text = 'wxid_wxj964t2shil12';
				uni.setClipboardData({
					data: text,
					success: () => {
						// 提示用户复制成功
						uni.showToast({
							title: '已复制到剪贴板',
							icon: 'success'
						});
						this.showtogroup = false
					},
				})
			},
			register(e) {
				if (!uni.getStorageSync('token')) {
					index.navigate_to('/pagesC/login/login');
				} else {
					if (e == 1) {
						console.log('跳转企业')
						uni.navigateTo({
							url: "/pagesC/my/EnterpriseCertification"
						})
					}
					if (e == 2) {
						console.log('跳转个人')
						uni.navigateTo({
							url: "/pagesB/entRegister/entRegister?type=" + e
						})
					}
				}

			},
			txtSearchChoose(e) {
				console.log(e)
				this.search = e
				this.$refs.paging.reload();
			},
			//显示搜索下拉框
			showSearchChoice() {
				this.isShowSearchChoice = true
			},
			offSearchChoice() {
				setTimeout(() => {
					this.isShowSearchChoice = false;
				}, 100);
			},
			choice(index) {
				//当再次被选中时，取消当前选中项
				if (this.classifyList[index].selected == true) {
					this.classifyList[index].selected = false;
					//取消选中时删除数组中的值
					for (var i = 0; i < this.selectId.length; i++) {
						if (this.selectId[i] === this.classifyList[index].id) {
							this.selectId.splice(i, 1);
						}
					}
					this.selectList = this.selectId
					console.log("选中的值", this.selectId)
					console.log("选中的值selectList", this.selectList)
				} else {
					this.classifyList[index].selected = true;
					this.selectId.push(this.classifyList[index].id)
					for (var i = 0; i < this.selectId.length; i++) {
						console.log("选中的值", this.selectId[i])
					}
					this.selectList = this.selectId
					console.log("选中的值", this.selectId)
					console.log("选中的值selectList", this.selectList)
				}
			},
			//提交筛选
			onConfirmFiltrate() {
				this.show = false
				console.log(this.selectList, "选择结果数组-----");
				this.$refs.paging.reload();
			},
			onrecv(data) {
				console.log('市：' + data.provinceName);
				console.log('监听到事件来自 update ，携带参数 msg 为：' + data.cityName);
				this.provinceName = data.provinceName
				this.cityName = data.cityName
				this.$refs.paging.reload();
			},
			gotoCity() {
				console.log('----------------城市切换')
				if (this.cityName) {
					uni.navigateTo({
						url: "/pages/index/checkCity/checkCity?city=" + this.cityName
					})
				} else if (this.provinceName) {
					uni.navigateTo({
						url: "/pages/index/checkCity/checkCity?city=" + this.provinceName
					})
				} else {
					uni.navigateTo({
						url: "/pages/index/checkCity/checkCity?city=" + '全国'
					})
				}


			},
			//选取分类
			onSelectClassify(id) {
				this.$set(this.selected, id, !this.selected[id]) //动态更新视图数据
			},
			//重置
			onClear() {
				// this.selected = {}
				for (var i = 0; i < this.classifyList.length; i++) {
					if (this.classifyList[i].selected == true) {
						let item = this.classifyList[i]
						item.selected = false
						this.$set(this.classifyList, this.classifyList[i], item)
					}
					// this.classifyList[index].selected = false;
				}
				this.selected = []
				this.select = []
				console.log(this.classifyList, "选择结果数组----classifyList-");
				console.log(this.selectList, "选择结果数组----selectList-");
				console.log(this.selectId, "选择结果数组----selectId-");
			},
			isShowgz() {
				if (!uni.getStorageSync('token')) {
					index.navigate_to('/pagesC/login/login');
					return false
				} else {
					index.getPublicUserMember({}, '/client/individual/homePage', 'get', res => {
						if (res.data.code == 200 && res.data.success) {
							this.showzg = true
							if (res.data.result.enIdentity != 0) {
								this.showcard = false
							} else {
								this.showcard = true
							}
							this.enIdentity = res.data.result.enIdentity

						} else if (res.data.code == '401') {
							uni.removeStorageSync('');
							index.navigate_to('../../pagesC/login/login');
						} else {
							index.show_tips(res.data.message);
							return false
						}
					})

				}

			},
			close() {
				this.show = false
			},
			closezg() {
				this.showzg = false
			},
			closegp() {
				this.showtogroup = false
			},
			closesc() {
				this.showsharecode = false
			},
			getLon() {
				uni.getLocation({
					type: 'wgs84',
					geocode: true,
					success: (res) => {
						console.log(res, '====dddd===')
						this.lat = res.latitude
						this.lon = res.longitude
						myAmapFun.getRegeo({
							location: this.lon + ',' + this.lat,
							success: (rs) => {
								console.log(rs, '====sddd====')
								let arr = rs
								this.cityName = arr[0].regeocodeData.addressComponent.city
							}
						})
					},
					fail: (err) => {
						uni.getSetting({
							success: (rs) => {
								let status = rs.authSetting
								if (!status['scope.userLocation']) {
									uni.showModal({
										title: '是否授权当前位置',
										content: '需要获取您的地理位置，请确认授权，否则地图功能将无法开启',
										success: (tip) => {
											if (tip.confirm) {
												uni.openSetting({
													success: (data) => {
														if (data
															.authSetting[
																'scope.userLocation'
															] === true
														) {
															index
																.show_tips(
																	'授权成功')
															uni.getLocation({
																type: 'wgs84',
																success: (
																	nodes
																) => {
																	console
																		.log(
																			'99999999999',
																			nodes
																		)
																}
															})
														} else {
															index
																.show_tips(
																	'授权失败')
															return false
														}

													}
												})
											}
										}
									})
								} else {
									uni.getLocation({
										type: 'wgs84',
										success: (nodes) => {
											console.log('001001001', nodes)
										}
									})
								}
							},
							fail: (noerr) => {
								index.show_tips('调用授权窗口失败')
								return false
							}
						})
					}
				})
			},
			searchbtn() {
				this.$refs.paging.reload();
			},
			navSearch() {
				index.navigate_to('../../pagesC/search/index')
			},
			goNavigate(url) {
				index.navigate_to(url);
			},
			addressCancel() {
				this.addressisShow = false
				this.cityId = null,
					this.areaId = null,
					this.provinceId = null,
					this.$refs.paging.reload();
			},
			addressConfirm(e) {
				console.log('当前选择的地址是', e)
				this.addressisShow = false
				this.cityId = e.value[1],
					this.areaId = e.value[2],
					this.provinceId = e.value[0],
					this.$refs.paging.reload();
			},
			gongzhongCancel() {
				this.gongzhongisShow = false
				this.skillLevel1 = null
				this.skillLevel2 = null
				this.hangyeType = ''
				// this.skillLevel3 = null
				this.$refs.paging.reload();
			},
			addressbindMultiPickerColumnChange() {
				const {
					columnIndex,
					value,
					values, // values为当前变化列的数组内容
					index,
					// 微信小程序无法将picker实例传出来，只能通过ref操作
					picker = this.$refs.addressPicker
				} = e
				console.log('地点第几列：' + columnIndex + '，下标值为：' + index + '=====' + e.indexs)
				let arr = []
				for (let k = 0; k < this.cityList.length; k++) {
					arr[k] = this.cityList[k].name
				}
				this.addresscolumns[0] = arr
				console.log('行业类别1', arr)

				let arr1 = []
				if (this.cityList[e.indexs[0]].childone) {
					for (let k = 0; k < this.cityList[e.indexs[0]].childone.length; k++) {
						arr1[k] = this.cityList[e.indexs[0]].childone[k].name
					}
				}
				console.log('行业类别2', arr1)
				this.addresscolumns[1] = arr1

				let arr2 = []
				if (this.cityList[e.indexs[0]].childone[e.indexs[1]].childone) {
					for (let k = 0; k < this.cityList[e.indexs[0]].childone[e.indexs[1]].childone.length; k++) {
						arr2[k] = this.cityList[e.indexs[0]].childone[e.indexs[1]].childone[k].name
					}
				}
				this.address = e.value[0] + '/' + e.value[1]
				// + '/' + e.value[2]
				console.log('行业类别3', this.address)
				this.addresscolumns[2] = arr2
			},
			hangyeConfirm(e) {
				this.gongzhongisShow = false
				console.log('监听变化=====', e)
				this.hangyeType = e.value[0] + '/' + e.value[1]
				// + '/' + e.value[2]
				this.skillLevel1 = this.gongzhongList[e.indexs[0]].id
				this.skillLevel2 = this.gongzhongList[e.indexs[0]].children[e.indexs[1]].id
				// this.skillLevel3 = this.gongzhongList[e.indexs[0]].children[e.indexs[1]].children[e.indexs[2]].id
				this.$refs.paging.reload();
			},
			//picker滑动改变时触发
			bindMultiPickerColumnChange(e) {
				// console.log('监听变化', e)
				const {
					columnIndex,
					value,
					values, // values为当前变化列的数组内容
					index,
					// 微信小程序无法将picker实例传出来，只能通过ref操作
					picker = this.$refs.gongzhongPicker
				} = e
				console.log('第几列：' + columnIndex + '，下标值为：' + index + '=====' + e.indexs)
				// this.model.userInfo.type = this.gongzhongList[index].id
				// this.hangyeType = value[0]

				let arr = []
				for (let k = 0; k < this.gongzhongList.length; k++) {
					arr[k] = this.gongzhongList[k].skillName
				}
				this.gongzhongcolumns[0] = arr
				console.log('行业类别1', arr)

				let arr1 = []
				if (this.gongzhongList[e.indexs[0]].children) {
					for (let k = 0; k < this.gongzhongList[e.indexs[0]].children.length; k++) {
						arr1[k] = this.gongzhongList[e.indexs[0]].children[k].skillName
					}
				}
				console.log('行业类别2', arr1)
				this.gongzhongcolumns[1] = arr1

				// let arr2 = []
				// if (this.gongzhongList[e.indexs[0]].children[e.indexs[1]].children) {
				// 	for (let k = 0; k < this.gongzhongList[e.indexs[0]].children[e.indexs[1]].children.length; k++) {
				// 		arr2[k] = this.gongzhongList[e.indexs[0]].children[e.indexs[1]].children[k].skillName
				// 	}
				// }
				// this.hangyeType = e.value[0] + '/' + e.value[1] + '/' + e.value[2]
				// console.log('行业类别3', this.hangyeType)
				// this.gongzhongcolumns[2] = arr2
				this.skillLevel1 = this.gongzhongList[e.indexs[0]].id
				this.skillLevel2 = this.gongzhongList[e.indexs[0]].children[e.indexs[1]].id
				// this.skillLevel3 = this.gongzhongList[e.indexs[0]].children[e.indexs[1]].children[e.indexs[2]].id
				console.log('工种ID', this.skillLevel1, this.skillLevel2)
			},
			//查询工种
			getQueryType() {
				let types = "construction"
				this.Qurylist = []
				// index.getPublicMember({}, 'client/skills/listV2/' + types, 'get', res => {
				// 	if (res.data.success && res.data.code == 200) {
				// 		this.gongzhongList = res.data.result
				// 		let arr = []
				// 		for (let k = 0; k < this.gongzhongList.length; k++) {
				// 			arr[k] = this.gongzhongList[k].skillName
				// 		}
				// 		this.gongzhongcolumns[0] = arr
				// 		console.log('行业类别1', arr)
				// 		let arr1 = []
				// 		if (this.gongzhongList[0].children) {
				// 			for (let k = 0; k < this.gongzhongList[0].children.length; k++) {
				// 				arr1[k] = this.gongzhongList[0].children[k].skillName
				// 			}
				// 		}
				// 		console.log('行业类别2', arr1)
				// 		this.gongzhongcolumns[1] = arr1
				// 		let arr2 = []
				// 		if (this.gongzhongList[0].children[0].children) {
				// 			for (let k = 0; k < this.gongzhongList[0].children[0].children.length; k++) {
				// 				arr2[k] = this.gongzhongList[0].children[0].children[k].skillName
				// 			}
				// 		}
				// 		console.log('行业类别33', arr2)
				// 		this.hangyeType = arr[0] + '/' + arr1[0] + '/' + arr2[0]
				// 		this.gongzhongcolumns[2] = arr2
				// 	}
				// })
				index.getPublicMember({}, 'client/skills/firAndSecList/', 'get', res => {
					if (res.data.success && res.data.code == 200) {
						this.gongzhongList = res.data.result
						let arr = []
						for (let k = 0; k < this.gongzhongList.length; k++) {
							arr[k] = this.gongzhongList[k].skillName
						}
						this.gongzhongcolumns[0] = arr
						console.log('行业类别1', arr)
						let arr1 = []
						if (this.gongzhongList[0].children) {
							for (let k = 0; k < this.gongzhongList[0].children.length; k++) {
								arr1[k] = this.gongzhongList[0].children[k].skillName
							}
						}
						console.log('行业类别2', arr1)
						this.gongzhongcolumns[1] = arr1
						// let arr2 = []
						// if (this.gongzhongList[0].children[0].children) {
						// 	for (let k = 0; k < this.gongzhongList[0].children[0].children.length; k++) {
						// 		arr2[k] = this.gongzhongList[0].children[0].children[k].skillName
						// 	}
						// }
						// console.log('行业类别33', arr2)
						// this.hangyeType = arr[0] + '/' + arr1[0] 
						// + '/' + arr2[0]
						// this.gongzhongcolumns[2] = arr2
					}
				})
			},
			// 隐藏键盘
			hideKeyboard() {
				uni.hideKeyboard()
			},
			appearmask() {
				this.showappearmask == true
				console.log("appearmask")
			},
			bannerClick(ind) {
				console.log("名企", ind)
				// this.itemClick(this.topbannerlist[index])
				// if(index == 0){
				// 	uni.navigateTo({
				// 	url: '/pagesB/famousEnterprises/famousEnterprises' 
				// })
				// }
				if (this.topbannerlist[ind].name == '名企招聘') {
					uni.navigateTo({
						url: '/pagesB/famousEnterprises/famousEnterprises'
					})
				}
				if (this.topbannerlist[ind].name == '兼职推广') {
					index.show_tips('请前往app内使用')
				}
				if (this.topbannerlist[ind].name == '广告') {
					this.getqrcode()

				}
				if (this.topbannerlist[ind].name == '抽奖') {
					uni.navigateTo({
						url: '/pages/prizeDraw/prizeDraw'
					})
				}
			},
			getqrcode() {
				this.showuploadImage = true
				index.getPublicUserMember({
					path: 'pages/user/index',
					code: uni.getStorageSync('userid')
				}, "/client/share/wxQrcode", 'get', res => {
					if (res.data.code == 200) {
						this.bufferImg = res.data.result
						this.showsharecode = true
						this.showuploadImage = false
					} else {
						if (uni.getStorageSync('userid') == '') {
							index.show_tips('请先登录')
						} else {
							index.show_tips('二维码请求失败')
						}


						this.showuploadImage = false
					}
				})

			},
			itemClick(data) {
				let item = data
				console.log("点击点击点击", data)
				if (this.cityName) {
					item.city = this.cityName
				} else {
					item.city = ''
					item.province = this.provinceName
				}
				let datastr = JSON.stringify(item)
				console.log('金刚区', datastr)
				uni.navigateTo({
					url: '/pagesB/jobinfo/jobLeavetwo?data=' + encodeURIComponent(datastr)
				})
			},
			goNavigate(url) {
				index.navigate_to(url);
			},
			btnClick() {
				this.showzg = false
				if (!uni.getStorageSync('token')) {
					index.navigate_to('/pagesC/login/login');
					return false
				} else {
					if (this.homepage.isEnterprise == 1) {
						uni.navigateTo({
							url: "/pagesB/changeIdentity/changeIdentity?type=1"
						})
					} else {
						uni.navigateTo({
							url: "/pagesC/job/issuejob?address=" + this.cityName + '&entid=' + this.enIdentity
						})
					}
				}
			},
			btnClick2() {
				this.showzg = false
				console.log(this.userinfo);
				if (uni.getStorageSync('token')) {
					// index.navigate_to(url)
					let uid = uni.getStorageSync('userid')
					console.log('当前登录的用户id是', this.uid)
					uni.navigateTo({
						url: '/pagesC/my/MyEditUserInfo?type=1&userId=' + uid
					})
				} else {
					uni.navigateTo({
						url: "/pagesC/login/login"
					});
				}
			},
			jobItemClick(data) {
				if (this.homepage.isEnterprise == 1 && this.homepage.enIdentity != 0) {
					console.log("需要切换个人")
					uni.navigateTo({
						url: "/pagesB/changeIdentity/changeIdentity?type=0"
					})
				} else {
					let sends = {
						"userId" : uni.getStorageSync("userid")?uni.getStorageSync("userid"):'',
						"clientType":1,
						"pages":'job',
						"businessId":data.data.id
					}
					index.getPublicUserMember(sends, '/visitLog/add', 'post', res => {
						if (res.statusCode == 200 && res.data.success) {
							console.log('日活统计',res)
						} else {
							console.log('日活统计失败',res)
						}
					})
					uni.navigateTo({
						url: "/pagesB/jobinfo/jobLeavetwoInfo?cardID=" + data.data.id + '&&isInfoAll=' + this
							.homepage.isPublish
					})
					uni.setStorage({
						key: 'cardID',
						data: data.data.id,
						success: () => {
							console.log('存入成功')
						}
					})
				}
			},
			getBanner() {
				index.getPublicMember({}, '/client/public/kingganglist', 'get', res => {
					this.bannerList = res.data.result;
					console.log('banner2返回的结果是', this.bannerList);
				})
				index.getPublicMember({}, '/system/appBannerPicture/avaliableBannerList?position=2', 'get', res => {
					this.topbannerlist = res.data.result;
					console.log('topbannerlist返回的结果是', res.data.result);
				})
			},
			//非授权获取找活列表
			getList(pageNo, pageSize) {
				let leves = this.skillLevel1 + "," + this.skillLevel2
				// let str = this.selectList.length>0?this.selectList.join(','):''
				let ids = this.selectList.length > 0 ? this.selectList.join(',') : ''
				console.log('str分页数据====', pageNo, pageSize, ids)
				let send = {
					pageNum: pageNo,
					pageSize: pageSize,
					skillLevels: leves,
					cityId: this.cityId,
					areaId: this.areaId,
					provinceId: this.provinceId,
					cityName: this.cityName,
					provinceName: this.provinceName,
					keyWords: this.search,
					// lon: this.lon,
					// lat: this.lat,
					labelIds: ids
					// labelIds:JSON.stringify(this.selected)
					// skillLevel2:this.skillLevel2,
					// skillLevel3:this.skillLevel3
				}
				index.getPublicMember(send, 'client/recuitjob/listNoSe', 'get', res => {
					this.$refs.paging.complete(res.data.result.records);
				})
			},
			getTypeItem() {
				index.getPublicMember({}, 'client/public/labellist', 'get', res => {
					// this.$refs.paging.complete(res.data.result.records);
					console.log("标签内容是", res.data.result);
					this.classifyList = res.data.result
				})
			}

		}
	}
</script>
<style lang="scss" scoped>
	@import url("index.css");
	@import url("@/static/css/publics.css");

	/* 已选择 */
	.selde {
		border: 1px solid #0575ff;
		background: #0575ff;
		color: #FFFFFF;
		border-radius: 8px;
		font-size: 14px;
		// padding: 0 10upx;
		justify-content: center;
		display: flex;
		align-items: center;
		padding: 10px;
		text-align: center;
	}

	/* 未选择 */
	.noselde {
		display: flex;
		align-items: center;
		border: 1px solid #959595;
		background: #FFFFFF;
		color: #959595;
		border-radius: 8px;
		font-size: 14px;
		padding: 10px;
		text-align: center;
		justify-content: center;
	}

	.valueList {
		margin-top: 20rpx;
		padding: 20rpx;
		display: flex;
		justify-content: center;
	}

	.tl-flex-center1 {
		display: flex;
		height: 60px;
		flex-direction: row;
		justify-content: space-between;
		// padding: 30px;
		background-color: #F3F3F3;
		text-align: center;
		align-items: center;
		padding-left: 30px;
		padding-right: 30px;
		opacity: 0.5;
	}

	.classifyBigBox {
		// margin: 47rpx 0;
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		grid-gap: 50rpx;
		padding: 10px;
	}

	.hide-tabbar {
		display: none;
	}

	.tl-btn-120 {
		width: 180rpx;
		// padding: 17rpx;
		background: #F3F3F3;
		color: #999;
		border-radius: 13rpx;
		// border: 2rpx solid #dedede;
		text-align: center;
		height: 35px;
	}

	.onConfirmFiltrate {
		width: 180rpx;
		// padding: 17rpx;
		height: 25px;
		background: #2851F3;
		color: #FFFFFF;
		border-radius: 13rpx;
		text-align: center;
		margin-left: 35rpx;
	}

	::v-deep {
		.u-navbar--fixed {
			background-size: 100%;
			background-image: url('https://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/bg1.png');
			background-repeat: no-repeat;

			// background-image: linear-gradient(to bottom, #42cdff, #0288ff);
			&>view {
				background: transparent !important;
			}

			.leftText {
				color: #fff;
				font-size: 36rpx;
				font-weight: bold;
			}
		}
	}

	/*横向滚动操作*/
	.twoWork {
		width: 100%;
		height: 100rpx;
		padding: 20rpx 20rpx 0rpx 20rpx;
		box-sizing: border-box;
		overflow: hidden;
		background: #F6F6F6;

		.icons {
			float: left !important;
			margin-top: 10rpx;
			margin-left: 10rpx;
			width: 32rpx !important;
			flex-wrap: wrap !important;
		}

		.twoWorkLeft {
			color: #0F0F0F;
			float: left;
			width: 60rpx;
			font-size: 28rpx;
		}

		.twoWorkList {
			float: left;
			width: calc(100% - 264rpx);
		}

		.twoWorkRight {
			float: right;
			width: 120rpx;
			text-align: right;
			color: rgba(255, 255, 255, 0.8);
		}

		.content-scroll {
			white-space: nowrap;

			.scroll-item {
				height: 50rpx;
				line-height: 50rpx;
				border-radius: 10rpx;
				display: inline-block;
				text-align: center;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: rgba(15, 15, 15, 0.8);
				margin-left: 28rpx;
				padding: 0rpx;

				&.active {
					color: #0F0F0F;
					font-weight: bold;
				}
			}

			.scroll-item:last-child {
				margin-right: 28rpx;
			}
		}
	}

	.content {
		background-image: url('https://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/bg1.png');
		background-size: 100%;
		background-repeat: no-repeat;
	}

	.setTop {
		padding: 20rpx;
		max-height: 60vh;

		.title {
			text-align: center;
			font-size: 36rpx;
			color: #3D3D3D;
			margin-bottom: 32rpx;
			display: -moz-box;
			-moz-line-clamp: 2;
			-moz-box-orient: vertical;
			overflow-wrap: break-word;
			word-break: break-all;
			white-space: normal;
			overflow: hidden;

		}

		.userMp {
			display: flex;
			background: #F4F4F4;
			border-radius: 6rpx;
			padding: 20rpx;
			margin-bottom: 20rpx;

			image {
				width: 104rpx;
				height: 104rpx;
				border-radius: 6rpx;
				margin-right: 22rpx;
			}

			.userName {
				flex: 1;

				.userNameS {
					display: flex;
					margin-bottom: 18rpx;

					view:nth-child(1) {
						color: #0f0f0f;
						font-size: 36rpx;
						line-height: 42rpx;
						font-weight: bold;
					}

					image {
						width: 28rpx;
						height: 28rpx;
						margin-left: 14rpx;
						margin-right: 10rpx;
						margin-top: 10rpx;
					}

					view:nth-child(3) {
						color: #a1a1a1;
						font-size: 24rpx;
						margin: 0rpx;
					}
				}

				.userNameC {
					color: #424242;
					font-size: 26rpx;

					text {
						margin-right: 32rpx;
					}
				}
			}

			view:nth-child(3) {
				margin-top: 32rpx;
				color: #424242;
			}
		}

		.job {
			background: #F4F4F4;
			padding: 32rpx 20rpx;
			margin-bottom: 20rpx;
			border-radius: 6rpx;

			view:nth-child(1) {
				font-size: 36rpx;
				line-height: 42rpx;
				margin-bottom: 20rpx;
				display: -moz-box;
				-moz-line-clamp: 2;
				-moz-box-orient: vertical;
				overflow-wrap: break-word;
				word-break: break-all;
				white-space: normal;
				overflow: hidden;
			}

			view:nth-child(2) {
				font-size: 26rpx;
				line-height: 31rpx;
			}
		}

		.active {
			background: #0575ff;
			color: #fff;

			.userName {
				.userNameS {
					view:nth-child(1) {
						color: #fff !important;
					}

					view:nth-child(3) {
						color: #fff !important;
					}
				}

				.userNameC {
					color: #fff !important;
				}
			}

			view:nth-child(3) {
				color: #fff !important;
			}
		}
	}

	.index {
		.searchTop {
			// background-image: url('https://xgr.oss-cn-hangzhou.aliyuncs.com/icon/icon/seachBg.png');
			// background-size: 100%;
			// background-repeat: no-repeat;

			display: flex;
			padding: 10rpx;
			align-items: center;

			.logo {
				// width: 64rpx;
				height: 64rpx;
				margin-right: 10rpx;

				image {
					width: 100%;
					height: 100%;
				}

				display:flex;
				flex-direction:row;
			}

			.search {
				flex: 1;
				display: flex;
				background: rgba($color: #fff, $alpha: 0.3);
				height: 60rpx;
				padding: 0 10rpx;
				border-radius: 8rpx;
				margin-right: 20rpx;

				::v-deep {
					.u-input {
						margin: 0 10rpx;
					}
				}
			}

			.right {
				color: #fff;
			}
		}

		.scroll-list {
			@include flex(column);

			&__goods-item {
				width: 20vw;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: space-between;

				&__text {
					text-align: center;
					font-size: 12px;
					margin-top: 5px;
				}
			}
		}

		.groupcard {
			width: 90%;
			margin: 0 auto;
			background-color: #ffffff;
			padding: 10rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-radius: 20rpx;

			.left {
				display: flex;
				align-items: center;
				justify-content: center;
				margin-left: 10rpx;
			}
		}

		.tabsCont {
			display: flex;
			flex-wrap: wrap;
			background: #037fff;
			align-items: baseline;
			padding: 0 20rpx 40rpx;

			::v-deep {
				.u-tabs {
					flex: 1;
					width: 60%;
				}
			}

			.left {
				color: rgba($color: #fff, $alpha: 0.8);
				margin-right: 10rpx;

				&.active {
					color: rgba($color: #fff, $alpha: 1);
					font-size: 28rpx;
				}
			}

			.right {
				color: rgba($color: #fff, $alpha: 0.8);
				margin-left: 20rpx;
			}

		}

		.listWaip {
			background: #fff;
			border-radius: 20rpx;
			margin-top: -20rpx;

			.filterTab {
				display: flex;

				// align-items: baseline;
				::v-deep {
					.u-tabs {
						flex: 1;

						.u-tabs__wrapper__nav__item__text.data-v-48634e29 {
							font-size: 20px;
							color: #606266;
						}
					}
				}

				.right {
					display: flex;
					color: #43B729;
					padding: 4rpx 8rpx;
					font-size: 24rpx;
					margin-right: 20rpx;
					margin-top: 20rpx;
					margin-left: 20rpx;
					line-height: 40rpx;
					height: 40rpx;
					background: #DAFFD2;
					flex-wrap: wrap;

					image {
						width: 40rpx;
						height: 40rpx;
						margin-right: 8rpx;
					}
				}
			}

			.filter {
				display: flex;
				justify-content: space-between;
				margin: 0 20rpx;
				padding: 20rpx 0;
				border-bottom: 0.5px solid #f0f0f0;

				.lTab {
					display: flex;
					font-size: 28rpx;
					color: #a1a1a1;

					view {
						margin-right: 20rpx;

						&.active {
							color: #424242;
						}
					}
				}

				.filterRight {
					display: flex;
					font-size: 24rpx;
					color: #a1a1a1;

					view {
						display: flex;
						margin-left: 30rpx;

						::v-deep {
							.u-icon {
								margin-left: 5rpx;
							}
						}
					}
				}
			}

			.complist {
				// background-image: url('http://xgr.oss-cn-hangzhou.aliyuncs.com/icon/images/comp-bg.png');
				background-repeat: no-repeat;
				background-position: bottom left;
			}

			.list {
				padding: 20rpx 20rpx 0;
				border-bottom: 10rpx solid #f3f3f3;

				.title {
					display: flex;
					flex-direction: row;

					// align-items: center;
					text {
						display: inline-block;
						background: #ff5964;
						height: 38rpx;
						line-height: 38rpx;
						text-align: center;
						color: #fff;
						width: 64rpx;
						font-size: 20rpx;
						margin-top: 10rpx;
						// padding: 4rpx 10rpx;
						border-radius: 8rpx;
						margin-right: 10rpx;
					}

					view {
						font-size: 36rpx;
						line-height: 50rpx;
						font-weight: bold;
					}
				}

				.cont {
					margin: 12rpx 0;
					font-size: 26rpx;
					color: #424242;
					text-overflow: -o-ellipsis-lastline;
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-line-clamp: 1;
					-webkit-box-orient: vertical
				}

				.tag {
					display: flex;
					flex-wrap: wrap;
					max-height: 70rpx;
					overflow: hidden;

					view {
						background: #f7f7f7;
						border-radius: 8rpx;
						font-size: 28rpx;
						padding: 10rpx;
						margin-right: 10rpx;
						color: #424242;
						margin-bottom: 10rpx;
					}

					.t1 {
						color: #ff5964;
					}

					.qy {
						background: rgba(255, 234, 202, 0.5);
						color: #d9a14e;
					}

					.sm {
						background: #E4F0FF;
						color: #037fff;
					}
				}

				.info {
					// padding-top: 20rpx;
					padding-bottom: 20rpx;
					// margin-top: 10rpx;
					align-items: baseline;
					// border-top: 0.5px solid #f0f0f0;
					display: flex;
					justify-content: space-between;

					.left {
						.top {
							display: flex;
							align-items: center;

							.name {
								color: #0f0f0f;
								font-weight: bold;
								font-size: 28rpx;
							}

							image {
								width: 32rpx;
								height: 32rpx;
								margin-left: 14rpx;
								margin-right: 10rpx;
							}

							.authMe {
								color: #a1a1a1;
								font-size: 24rpx;
							}

							.comp {
								color: #d9a14e;
								font-size: 24rpx;
							}
						}

						.addr {
							display: flex;
							color: #a1a1a1;
							font-size: 24rpx;
							margin-top: 20rpx;

							::v-deep {
								.u-icon {
									margin-right: 14rpx;
								}
							}
						}
					}

					.right {
						display: flex;
						margin-top: -10rpx;
						// flex-direction: column;
						align-items: flex-start;

						.t1 {
							background: #ddffd5;
							color: #424242;
							font-size: 24rpx;
							border-radius: 24rpx;
							padding: 2rpx 10rpx;
						}

						.t2 {
							background: #E4F0FF;
							color: #424242;
							font-size: 24rpx;
							border-radius: 24rpx;
							padding: 2rpx 10rpx;
						}

						.btn {
							margin-top: -10rpx;
							height: 60rpx;
							line-height: 60rpx;
							width: 140rpx;
							text-align: center;
							color: #fff;
							border-radius: 8rpx;
							background: #0575ff;
							font-size: 28rpx;
						}
					}
				}
			}
		}
	}

	.container {
		display: flex;
	}

	.adaptive-text {
		white-space: nowrap;
		/* 不换行 */
		overflow: hidden;
		/* 超出部分隐藏 */
		text-align: center;
		color: #FFFFFF;
	}

	.search {
		position: relative;
		flex: 1;
		display: flex;
		background: rgba($color: #fff, $alpha: 0.3);
		height: 60rpx;
		padding: 0 10rpx;
		border-radius: 8rpx;
		margin-right: 20rpx;

		::v-deep {
			.u-input {
				margin: 0 10rpx;
			}
		}
	}

	.search1 {
		position: relative;
		flex: 1;
		display: flex;
		height: 60rpx;
		border-radius: 8rpx;
		margin-right: 20rpx;
	}

	.showSearchChoice {
		position: absolute;
		width: 96%;
		top: 60rpx;
		right: 20rpx;
		background-color: #ffffff;
		z-index: 1;
		border-radius: 0 0 20rpx 20rpx;
		border-left: 1rpx solid black;
		border-right: 1rpx solid black;
		border-bottom: 1rpx solid black;
		overflow: hidden;
		// box-sizing: border-box;
	}

	.topqy {
		background-color: white;
		width: 100%;
		height: 80rpx;
		box-sizing: border-box;
		display: flex;
		justify-content: space-between;
	}

	.topqy-item {
		font-size: 28rpx;
		width: 49%;
		height: 100%;
		color: #0575FF;
		// background-color: #037fff;
		// border-radius: 20rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.zgbtn {
		margin-top: 20rpx;
		padding: 0 20rpx;
		box-sizing: border-box;
	}
</style>